import _axios from 'src/axios/AxiosConfig'
import Vue from 'vue'

export function getUserRouter () {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'data/asyncRouterDemo',
    method: 'get',
    responseType: 'text'
  })
}

export function login (username, password, uuid) {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/login',
    method: 'post',
    data: {
      username,
      password,
      uuid
    }
  })
}

export function logout () {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/logout',
    method: 'get'
  })
}

export function getUserList (filter) {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/user/list',
    method: 'get',
    params: {
      filter: filter
    }
  })
}

export function getUrlTree () {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/permiss/loadUrl',
    method: 'get'
  })
}
